<?php
    $format = $_GET['format'];
    $address = $_GET['address'];
    if ($format=='json'&$address!=null) {
        
        $addr2LongLatKey = "";  //apiKey  北京市海淀区彩和坊路海淀西大街74号
        $tencentApi = "https://apis.map.qq.com/ws/geocoder/v1/?address=";
        $result = file_get_contents($tencentApi.$address."&key=".$addr2LongLatKey);
        
        $s = json_decode($result, true);
        echo(json_encode($s['result']['location']));
    }else {
        echo("参数无效");
    }
    
?>